import { defineStore } from "pinia";
import { categoryGet } from "../api/job";
interface CategoryType {
  objectId: string;
  name: string;
}
interface CategoryStateType {
  list: Array<CategoryType>;
}
export const useCategory = defineStore("category", {
  state: (): CategoryStateType => {
    return {
      list: [],
    };
  },
  actions: {
    async initCateAction() {
      let res = await categoryGet();
      this.list = res.data.results;
    },
  },
});
